package cn.laixueit.api;

import cn.laixueit.pojo.Sku;
import cn.laixueit.pojo.Spu;
import cn.laixueit.pojo.SpuDetail;
import cn.laixueit.result.PageResult;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Controller
public interface SpuApi {
    @GetMapping("/sku/skuListBySpuId/{spuId}")
    public ResponseEntity<List<Sku>> skuListBySpuId(@PathVariable("spuId")Long spuId);

    @GetMapping("/spuDetail/{id}")
    public ResponseEntity<SpuDetail> spuDetail(@PathVariable("id")Long id);

    @GetMapping("/spu/page")
    public ResponseEntity<PageResult<Spu>> spuPage(@RequestParam(value = "key",required = false)String key,
                                                   @RequestParam(value = "saleable",required = false)Boolean saleable,
                                                   @RequestParam("page")Integer page,
                                                   @RequestParam("rows")Integer rows);
}
